# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pkgname=flask-paranoid
pkgname=python-flask-paranoid
pkgver=0.3.0
pkgrel=2
pkgdesc='Simple user session protection for Flask applications'
url='https://github.com/miguelgrinberg/flask-paranoid/'
arch=('any')
license=('MIT')
depends=('python' 'python-flask')
makedepends=('python-sphinx' 'python-setuptools')
checkdepends=('python-pytest')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/miguelgrinberg/flask-paranoid/archive/v${pkgver}.tar.gz)
sha256sums=('cab9f54e382707c31eb5ad58e1ce3b371ecd0d5d4f3385f9cf01bd13a2e1d9ec')
sha512sums=('68e49a79e7e00c3a89bcc0347c41b80634b3f5f64227f4ae44db95a286a57b6101dff8f7aba592b8d325b38effc58744ee15d56bd8be30507b76c5dc836fc112')

build() {
  cd ${_pkgname}-${pkgver}
  python setup.py build
  sphinx-build -b text docs docs/_build/text
  sphinx-build -b man docs docs/_build/man
}

check() {
  cd ${_pkgname}-${pkgver}
  python setup.py test
}

package() {
  cd ${_pkgname}-${pkgver}
  python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 docs/_build/text/*.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 docs/_build/man/flask-paranoid.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
}

# vim: ts=2 sw=2 et:
